package com.hospital.yang.fchua.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hospital.yang.fchua.dao.DrugRemedyMapper;
import com.hospital.yang.fchua.entity.DrugRemedy;
import com.hospital.yang.fchua.service.DrugRemedyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description：
 * @author：xyj
 * @date：2021/9/23 11:25
 * @versions：v1.0
 */
@Service
public class DrugRemedyServiceImpl implements DrugRemedyService {
    @Autowired
    private DrugRemedyMapper drugRemedyMapper;

    /**
     * 根据药drugname查询价格
     *
     * @return
     */
    @Override
    public double selectPrice(String drugname) {
        QueryWrapper<DrugRemedy> wrapper = new QueryWrapper<>();
        wrapper.eq("drugname", drugname);
        DrugRemedy drugRemedy = drugRemedyMapper.selectOne(wrapper);
        return drugRemedy.getPrice();
    }
}
